<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
    //   求一组数中的最大值和最小值，以及所在位置的下标。  
    let scores = [100,70,50,85,60,0,95,78,82,88]

    let max = Math.max(...scores)   //  相当于展开 
    let min = Math.min(...scores)

    console.log('最大值为：' + max + '它的下标：' + scores.indexOf(max))
    console.log('最小值为：' + min + '它的下标：' + scores.indexOf(min))
    </script>
</head>
<body>
    
</body>
</html>